﻿using System;
using Dexter.Dependency;
using Dexter.Dependency.Installation;
using Dexter.Scheduler.Quartz.Factory;
using Dexter.Services;
using Quartz.Spi;

namespace Dexter.Scheduler.Quartz.LayerInstaller {
	/// <summary>
	/// 	Implementation of <see cref = "ILayerInstaller" />
	/// </summary>
	public class SchedulerInstaller : ILayerInstaller {

		/// <summary>
		/// 	Installs all the component needed by the assembly.
		/// </summary>
		/// <param name = "container">The container.</param>
		public void ServiceRegistration ( IDexterContainerRegister container ) {
			container.Register<IScheduler, Dexter.Scheduler.Quartz.Scheduler> ( typeof ( IScheduler ).FullName, LifeCycle.Singleton );
			container.Register<IJobFactory, DexterJobFactory> ( typeof ( IJobFactory ).FullName, LifeCycle.Singleton );
		}

		/// <summary>
		/// 	Setups the service.
		/// </summary>
		/// <param name = "container">The container.</param>
		public void ServiceRegistrationComplete ( IDexterContainerResolver container ) {
		}

		/// <summary>
		/// 	Setups the service.
		/// </summary>
		/// <param name = "container">The container.</param>
		public void ApplicationStarted ( IDexterContainerResolver container ) {
		}
	}
}